#Warning: must be root!

Version=0.9.8e
InstallDir:=$(shell pwd)/tmp/usr

.PHONY: all clean dist_clean

all:openssl.tgz

openssl.tgz: openssl-$(Version).tar.gz  openssl.cnf
	tar -xzf openssl-$(Version).tar.gz
	mkdir -p $(InstallDir) usr/local/ssl 
	cd openssl-$(Version);./config --prefix=$(InstallDir) shared
	$(MAKE) -C openssl-$(Version)
	$(MAKE) -C openssl-$(Version) install
	mkdir -p usr/lib
	cp -af $(InstallDir)/lib/libcrypto.so usr/lib
	cp -af $(InstallDir)/lib/libcrypto.so.0.9.8 usr/lib/libcrypto.so.0.9.8
	cp -af $(InstallDir)/lib/libssl.so usr/lib
	cp -af $(InstallDir)/lib/libssl.so.0.9.8 usr/lib
	cp -rf openssl.cnf usr/local/ssl
	tar -czf openssl.tgz usr

clean:
	rm -rf *.tgz usr tmp

dist_clean:clean
	rm -rf *.tar.gz openssl-$(Version)
	

include ../Makefile.Res
